//---------------------------------------------------
// This function loads the parts of your skeleton 
// (navbar, footer, and other things) into html doc. 
//---------------------------------------------------
function loadSkeleton() {

    // No user is signed in.
    console.log($('#navbarPlaceholder').load('./text/nav_before_login.html'));
    console.log($('#footerPlaceholder').load('./text/footer.html'));

    var user = JSON.parse(localStorage.getItem("loggedinUser"));
    if (user) {

        console.log($('#navbarPlaceholder').load('./text/nav_after_login.html')); 
    } else {

        console.log($('#navbarPlaceholder').load('./text/nav_before_login.html')); 
    }
    
    console.log($('#footerPlaceholder').load('./text/footer.html')); 

}
loadSkeleton(); //invoke the function